//管理材料类型数据相关
import {defineStore} from "pinia";
import { ref} from "vue";
import { useGetMaterialTypeAPI } from "@/apis/materialType.ts";

export const useMaterialTypeStore=defineStore('materialType',()=>{

        //1.定义菜单的数据的state
        const fullMaterialType=ref([]);

        const getFullMaterialType=async ( current:number,pageSize:number)=>{
            const res=await  useGetMaterialTypeAPI(current,pageSize);
            fullMaterialType.value=res.data;
        }

        //3.以对象的格式把state和action return
        return {
            fullMaterialType,getFullMaterialType
        }
    }

)